diff options
| author | 0-Zz-ang <s1998319@gmail.com> | 2025-11-21 12:01:13 +0900 |
|---|---|---|
| committer | 0-Zz-ang <s1998319@gmail.com> | 2025-11-21 12:01:13 +0900 |
| commit | eacfa3f36274e495838a7114d68ff80a0f257a6a (patch) | |
| tree | 7044bcf0b8608ca8ff63a3d06d25b2d00ef20864 /app/[lng] | |
| parent | 935fd22e17afc034a472bc2d159de7b9f5e5dcae (diff) | |
(박서영)모든상태 레코드 활성화
Diffstat (limited to 'app/[lng]')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/(master-data)/compliance/page.tsx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/app/[lng]/evcp/(evcp)/(master-data)/compliance/page.tsx b/app/[lng]/evcp/(evcp)/(master-data)/compliance/page.tsx index 3b97ce99..cf624ae8 100644 --- a/app/[lng]/evcp/(evcp)/(master-data)/compliance/page.tsx +++ b/app/[lng]/evcp/(evcp)/(master-data)/compliance/page.tsx @@ -1,10 +1,12 @@ import * as React from "react" import { type SearchParams } from "@/types/table" +import { getValidFilters } from "@/lib/data-table" import { Skeleton } from "@/components/ui/skeleton" import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" import { Shell } from "@/components/shell" -import { getComplianceSurveyTemplatesWithPagination } from "@/lib/compliance/services" +import { getComplianceSurveyTemplates } from "@/lib/compliance/services" +import { searchParamsComplianceCache } from "@/lib/compliance/validations" import { ComplianceSurveyTemplatesTable } from "@/lib/compliance/table/compliance-survey-templates-table" import { InformationButton } from "@/components/information/information-button" @@ -14,18 +16,16 @@ interface IndexPageProps { export default async function IndexPage(props: IndexPageProps) { const searchParams = await props.searchParams - - // pageSize 기반으로 모드 자동 결정 (items 페이지와 동일한 로직) - const search = { page: 1, perPage: 10, ...searchParams } - const isInfiniteMode = search.perPage >= 1_000_000 - - // 페이지네이션 모드일 때만 서버에서 데이터 가져오기 - // 무한 스크롤 모드에서는 클라이언트에서 SWR로 데이터 로드 - const promises = isInfiniteMode - ? undefined - : Promise.all([ - getComplianceSurveyTemplatesWithPagination(), - ]) + const search = searchParamsComplianceCache.parse(searchParams) + + const validFilters = getValidFilters(search.filters) + + const promises = Promise.all([ + getComplianceSurveyTemplates({ + ...search, + filters: validFilters, + }), + ]) return ( <Shell className="gap-2"> |
